package com.pjj.base.base.utils;

/**
 * @author 76004
 * @apiNote
 * @date 2023/3/1 15:54
 */

public class MathUtil {

    public static Integer quickPow(Integer a,Integer b){
        Integer res = 1;
        while(b > 0){
            if(b%2 == 1)res = res*a;
            b /= 2;
        }
        return res;
    }

    public static Integer calculatePow(Integer base,Integer number){
        Integer res = 0;
        while(number != 1){
            number /= base;
            res++;
        }
        return res;
    }
}
